# -*- coding: utf-8 -*-
# @Time : 2021/10/8 9:48
# @Author : 张宇鹏
# @FileName: 1.py.py
import pandas as pd
import numpy as np

# df = pd.read_excel('./input/T480_DEMO004V4_AB2_proteins.xlsx')
# # x = df[1]  # 读取第一列数据
# # print(x)
# height, width = df.shape
# print(height, width, type(df))
# # x = np.zeros((height,width))
# x = np.array(np.str("1"))#.reshape(width,height))
# print(x)
# for i in range(0, height):
# 	for j in range(1, width+1):  # 遍历的实际下标，即excel第一行
# 		# x[i][j - 1] = df.ix[i, j]
# 		x[i][j - 1] = df.iloc[i, j]
# print(x.shape)
# print(x)


import pandas as pd
import os
for name in os.listdir("./input"):
    print(name)
    # try:
    data = pd.read_excel('./input/' + name, index_col=1)
    try:
        data = data.drop('GO Accessions', 1)
    except:
        pass
    data.to_csv('./output/' + name + '.csv', encoding='utf-8')
    # except:
    #     print("失败")

    # data = pd.read_excel('./data/' + name, index_col=1)
    # data = data.drop('GO Accessions', 1)
    # data.to_csv('./csv/' + name + '.csv', encoding='utf-8')